package managedbean;

import java.util.Locale;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

@ManagedBean(name = "internationalisationManagedBean")
@SessionScoped
public class InternationalisationManagedBean {

		private Locale langue = FacesContext.getCurrentInstance().getApplication().getDefaultLocale();

		public Locale getLangue() {
			return langue;
		}

		public void setLangue(Locale langue) {
			this.langue = langue;
		}
	
		public void initLangue(String langue, String pays){
			this.langue= new Locale(langue, pays);
			FacesContext.getCurrentInstance().getViewRoot().setLocale(getLangue());
			
		}
		
}
